<script setup>
//通过defineEmits() ->e,it(this.$emit)

const emit = defineEmits(['get-message'])
const sendMsg = () => {
// 触发自定义事件，传数据给父组件
emit('get-message','this is son message')
}
</script>

<template>
    <div>
        子组件son
    </div>
    <button @click="sendMsg">触发自定义事件</button>
</template>